import Vue from "vue";

import "normalize.css/normalize.css"; // A modern alternative to CSS resets

import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
// import locale from "element-ui/lib/locale/lang/en"; // lang i18n

import "@/styles/index.scss"; // global css

import App from "./App";
import store from "./store";
import router from "./router";

import "@/icons"; // icon
import "@/permission"; // permission control

// 引入product 相关的全部api接口
import * as Api from "@/api/product";

import Category from '@/components/Category'

if (process.env.NODE_ENV === "production") {
  const { mockXHR } = require("../mock");
  mockXHR();
}

// Vue.use(ElementUI, { locale })  // 设置element-ui默认语言为英文
Vue.use(ElementUI); // 设置element-ui默认语言为中文

Vue.config.productionTip = false;

Vue.component('Category',Category)

new Vue({
  el: "#app",
  router,
  store,
  beforeCreate() {
    // 将product 相关的全部api接口 放到Vue原型上
    Vue.prototype.$api = Api;
    // 全局事件总线
    Vue.prototype.$bus = this
  },
  render: (h) => h(App),
});
